package com.atguigu.day03;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;

/**
 * @author Felix
 * @date 2024/7/10
 * 该案例演示了从集合中读取数据
 */
public class Flink04_Source_Col {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        //DataStreamSource<Integer> ds = env.fromCollection(Arrays.asList(1, 1, 2, 4, 5));
        DataStreamSource<Integer> ds = env.fromElements(1, 2, 4, 5, 6);
        ds.print();
        env.execute();
    }
}
